<?php
session_start();
header('Access-Control-Allow-Origin: *');
//Deze file alleen lokaal aanpassen en niet committen
//Verander deze waarde locaal naar de map in je localhost waar je de site hebt draaien
$site = "/hacog";
$url = str_replace($site, "", $_SERVER["REQUEST_URI"]);
$pagetree = explode("/",$url);
if ($pagetree[1] != "" && isset($pagetree[1])){
    $page = $pagetree[1];
}else{
    $page = "";
}
if(file_exists("api/".$page.".php") && isset($page)){
    include "api/". $page . ".php";
}else{
    $return["error"] = "API not found";
    $return["version"] = "0.1";
    echo json_encode($return);
}
?>
